package com.panda.web.controller.commons;

import com.panda.common.annotation.Log;
import com.panda.common.core.domain.AjaxResult;
import com.panda.common.core.domain.R;
import com.panda.common.enums.BusinessType;
import com.panda.web.domain.dto.UserDTO;
import com.panda.web.domain.dto.wechatinfo.UserinfoDTO;
import com.panda.web.domain.vo.UserVO;
import com.panda.web.entity.commons.People;
import com.panda.web.mapper.commons.PeopleMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@CrossOrigin
@RestController
@RequestMapping("/people")
public class PeopleController {
    @Autowired
    PeopleMapper peopleMapper;



    /**
     * 查询公众号用户列表 无分页
     */
    @GetMapping("/choiceList")
    public R choiceList(People people) {
        List<People> peopleList = peopleMapper.selectList(null);
        return R.ok(peopleList,"ok");
    }


    /**
     * 修改用户个人信息
     */
    @Log(title = "在线人数", businessType = BusinessType.UPDATE)
    @PutMapping
    public R edit(@RequestBody People people) {

        return R.ok(peopleMapper.updateById(people),200,"ok");
    }

}
